'use strict';

# examples
# https://github.com/angular-ui/bootstrap/blob/master/src/buttons/test/buttons.spec.js
# https://github.com/angular-ui/bootstrap/blob/master/src/alert/test/alert.spec.js

describe 'breadCrumb directive', ()->

  beforeEach(module('UCX.Cmis'))
  $scope={}
  $compile={}
  $rootScope={}
  $timeout = {};
  beforeEach((inject (_$compile_, _$rootScope_,_$timeout_)->
    $compile = _$compile_
    $rootScope = _$rootScope_
    $timeout = _$timeout_
  ))
#  it 'tree目录长度的和 超过 container的话 应该会有一些tree的目录折叠', inject ()->
#    #  构造一个 tree长目录
#    $rootScope.folderTree = [
#      {name:'目录1'}
#      {name:'目录11'}
#      {name:'目录111'}
#      {name:'目录1111'}
#    ]
#    html='<div class="ba-col-m" style="width:400px;">
#    <bread-crumb class="breadcrumb sub-bg-color n-p" style="overflow: hidden;"
#      folder-tree="folderTree"
#    >
#    </bread-crumb>
#
#    </div>
#    '
##    $scope.readjust()
#    element = $compile(html)($rootScope);
#    $rootScope.$digest();
#    $timeout.flush()
#    parantEle = $('.ba-col-m')
#    console.log parantEle.html()
#    expect(element.width()).toEqual('')

  it 'autoSelect input ', inject ()->
    element = $compile("<input value='www.baidu.com' auto-select-all>")($rootScope);
    $rootScope.$digest();
#    click 这种事件 只能在 karma 坏境才能执行
    element.click()
    expect($rootScope.select_succ).toEqual(true)
